package com.vhall.component.entity.interactive.vo;

import com.vhall.component.framework.common.annotation.ParamName;
import lombok.Data;

import javax.validation.constraints.Min;
import java.io.Serializable;
import java.util.Objects;

/**
 * @author yuanzh
 * @date 2021/11/24
 */
@Data
public class QuestionAdmListReqVO implements Serializable {

    private static final long serialVersionUID = 6078328391781005822L;

    /**
     * 问卷标题/创建人昵称
     */
    @ParamName("keyword")
    private String keyword;

    @ParamName("start_time")
    private String startTime;

    @ParamName("end_time")
    private String endTime;

    /**
     * 页码
     */
    @ParamName("page")
    @Min(value = 1, message = "page参数不允许小于1！")
    private Integer page = 1;

    /**
     * 每页数量
     */
    @ParamName("page_size")
    @Min(value = 1, message = "page_size参数不允许小于1！")
    private Integer pageSize = 10;

    public void setDefault() {
        if (Objects.isNull(page)) {
            page = 1;
        }
        if (Objects.isNull(pageSize)) {
            pageSize = 10;
        }
    }
}
